<% if event_id.present? %>
    $(document).ready(function () {
        setTimeout(function () {
            var source = new EventSource('/event_source/<%= projection %>/<%= event_id %>');
            source.addEventListener('projected', function (e) {
                window.location.reload();
            });
        }, 1);
    });
<% end %>
